how do you make the number of encoder hidden units and decoder hidden units equal in Siraj Raval's seq2seq tutorial

您所在的位置:网站首页 encoder python how do you make the number of encoder hidden units and decoder hidden units equal in Siraj Raval's seq2seq tutorial

how do you make the number of encoder hidden units and decoder hidden units equal in Siraj Raval's seq2seq tutorial

#how do you make the number of encoder hidden units and decoder hidden units equal in Siraj Raval's seq2seq tutorial| 来源: 网络整理| 查看: 265

Based on the code from the Github repo, you are getting the dimension mismatch because for the encoder he uses the https://www.tensorflow.org/api_docs/python/tf/nn/bidirectional_dynamic_rnn. Hence, the cell state that is being passed to the decoder has both the cell states from the cell_fw and cell_bw concatenated together. That makes the cell state size of the encoder to be [batch_size, 2 * encoder_hidden_units]. Now, because the cell state size of both the encoder and the decoder have to be the same in order to set the initial state of the decoder to the final state of the encoder, the encoder_hidden_units have to be twice the size of decoder_hidden_units.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3